package o;

import androidx.annotation.NonNull;
import java.util.LinkedList;
import java.util.Queue;

public class cer {
    private cey ˊ;
    private final Object ˋ = new Object();
    private Queue<cez> ˎ = new LinkedList();
    private cez ॱ;

    public cer(cey o_cey) {
        this.ˊ = o_cey;
    }

    public boolean ˏ(@NonNull cez o_cez) {
        boolean z;
        synchronized (this.ˋ) {
            if (o_cez == null) {
                z = false;
            } else {
                z = this.ˎ.add(o_cez);
            }
        }
        return z;
    }

    public void ˋ() {
        Logger.ˏ("SequentialTaskExecutor", "start to run task");
        ˎ();
    }

    /* JADX WARNING: inconsistent code. */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    private void ˎ() {
        /*
        r4 = this;
        r1 = r4.ˋ;
        monitor-enter(r1);
        r0 = r4.ˎ;	 Catch:{ all -> 0x004d }
        r0 = r0.poll();	 Catch:{ all -> 0x004d }
        r0 = (o.cez) r0;	 Catch:{ all -> 0x004d }
        r4.ॱ = r0;	 Catch:{ all -> 0x004d }
        r0 = r4.ॱ;	 Catch:{ all -> 0x004d }
        if (r0 != 0) goto L_0x0023;
    L_0x0011:
        r0 = "SequentialTaskExecutor";
        r2 = "there is no task, execute finished";
        o.dna.ˎ(r0, r2);	 Catch:{ all -> 0x004d }
        r0 = r4.ˊ;	 Catch:{ all -> 0x004d }
        if (r0 == 0) goto L_0x0021;
    L_0x001c:
        r0 = r4.ˊ;	 Catch:{ all -> 0x004d }
        r0.al_();	 Catch:{ all -> 0x004d }
    L_0x0021:
        monitor-exit(r1);	 Catch:{ all -> 0x004d }
    L_0x0022:
        return;
    L_0x0023:
        r0 = "SequentialTaskExecutor";
        r2 = new java.lang.StringBuilder;	 Catch:{ all -> 0x004d }
        r2.<init>();	 Catch:{ all -> 0x004d }
        r3 = "runningTask = ";
        r2 = r2.append(r3);	 Catch:{ all -> 0x004d }
        r3 = r4.ॱ;	 Catch:{ all -> 0x004d }
        r3 = r3.getName();	 Catch:{ all -> 0x004d }
        r2 = r2.append(r3);	 Catch:{ all -> 0x004d }
        r2 = r2.toString();	 Catch:{ all -> 0x004d }
        o.dna.ˎ(r0, r2);	 Catch:{ all -> 0x004d }
        monitor-exit(r1);	 Catch:{ all -> 0x004d }
        r0 = r4.ॱ;
        r1 = new o.cer$2;
        r1.<init>(r4);
        r0.run(r1);
        goto L_0x0022;
    L_0x004d:
        r0 = move-exception;
        monitor-exit(r1);	 Catch:{ all -> 0x004d }
        throw r0;
        */
        throw new UnsupportedOperationException("Method not decompiled: o.cer.ˎ():void");
    }
}
